package com.uzai.common.enums;

/**
 * 订单返利状态
 * @Auther: liuqi
 * @Date: 2021/8/19 11:22
 * @Description:
 */
public enum OrderReStatusEnum {

    RE_STATUS_NO(0,"未返利"),
    RE_STATUS_YES(1,"已返利"),
    RE_STATUS_BACK(2,"已追回"),
    RE_STATUS_FROZEN(3,"已冻结"),
    RE_STATUS_UNFROZEN_FAIL(4,"解冻失败");

    public static final int RE_STATUS_NO_VALUE = 0;
    public static final int RE_STATUS_YES_VALUE = 1;
    public static final int RE_STATUS_BACK_VALUE = 2;
    public static final int RE_STATUS_FROZEN_VALUE = 3;
    public static final int RE_STATUS_UNFROZEN_FAIL_VALUE = 4;

    private Integer value;
    private String desc;

    OrderReStatusEnum(Integer value, String desc) {
        this.value = value;
        this.desc = desc;
    }

    public Integer getValue() {
        return value;
    }

    public void setValue(Integer value) {
        this.value = value;
    }

    public String getDesc() {
        return desc;
    }

    public void setDesc(String desc) {
        this.desc = desc;
    }

    public static OrderReStatusEnum getById(Integer id) {
        if (id == null) {
            return null;
        }
        for (OrderReStatusEnum type: OrderReStatusEnum.values()) {
            if (type.getValue().intValue() == id) {
                return type;
            }
        }
        return null;
    }
}
